import { defineStore } from "pinia";

export interface UseBoolean {
  leftShow: boolean;
  rightShow: boolean;
  pieChartsListersShow: boolean;
  footerToolShow: boolean;
  headerTopShow: boolean;
  footerBottomShow: boolean;
  fixedRouteShow: boolean;
}

const useBoolean = defineStore("UseBoolean", {
  state: (): UseBoolean => {
    return {
      leftShow: true,
      rightShow: true,
      pieChartsListersShow: false,
      footerToolShow: false, //首页底部工具栏是否显示
      headerTopShow: true,
      footerBottomShow: true,
      fixedRouteShow: false, // 漫游弹窗是否显示
    }
  },
  actions: {
    setState(newValue) {
      this.leftShow = newValue;
      this.rightShow = newValue;
    },
    setTopFooter(newValue) {
      this.headerTopShow = newValue;
      this.footerBottomShow = newValue;
    },
    setLeftState(newValue) {
      this.leftShow = newValue;
    },
    setRightState(newValue) {
      this.rightShow = newValue;
    },
    setPieState(newValue) {
      this.pieChartsListersShow = newValue;
    },
    setFooterToolShow(newValue) {
      this.footerToolShow = newValue;
    },
    setFixedRoute(newValue) {
      this.fixedRouteShow = newValue;
    },
  },
});

export default useBoolean;
